The present invention relates to a document processing method and apparatus, which can add additional data such as a comment to a document.
A document processing apparatus, with which a user can add some comments to a portion of a document (e.g., a manual) stored in, e.g., a floppy disk, is known. FIG. 102 shows an example of a document (to be referred to as an original document hereinafter) furnished with a comment, and the display state of the comment. On a CRT screen 120, two windows are displayed. An original document is displayed on a text window 111, and a comment is displayed on a comment window 112. Therefore, the original document and the comment are displayed on different windows, and the position of the original document where the comment is added is represented by a line 113 connecting the two windows.
In this case, as a method of adding a comment to an original document, a special code as link information may be embedded in original document data. The comment is linked with the original document by the link information embedded in the original document, and the comment can be displayed by following the link information. Therefore, in the method of embedding the link information in the original document, a user who adds a comment must have an authority for embedding link information in an original document. In such an original document file, the same comment is displayed for any users who open the file. If another user added a comment, then the added comment is displayed. The contents (sentences) of the comment and the original document may be stored in the same file or in different files.
As a method of adding a comment for a user who cannot modify an original document, an original document and a comment are stored in different files (an original document file and a comment file), and when the comment and the original document are to be displayed, a system is started by inputting IDs (e.g., file names) of the two files, so as to link and display these data. In this case, information indicating a correspondence between the comment and the position of the original document is possessed by the comment file. For example, the comment file has position information indicating a correspondence between a comment and the ordinal number of the character in question from the beginning of the original document file.
In this method, each user can independently have a comment file, respectively, and the original document file is shared by all users. For this reason, no authority of modifying the original document file is required, and a user can display a document while displaying his or her own comment, without displaying comments added by other users. If the system arrangement allows to display comments added by other users, a user can display a document while displaying such comments, as a matter of course.
In the above-mentioned example, the number of characters from the beginning of the original document file or a special code embedded in original document data is used as position information indicating the adding position of a comment in the original document. Therefore, the position information of the comment and the state of the original document file are closely related to each other. For this reason, when the original document is partially modified to be a new version, and becomes a quite different document in terms of data, all comments added so far become meaningless even if the documents of old and new versions have similar contents.
For example, when a comment is added using link information, if a modified document (new document) is provided as a new document file, since no link information is embedded in the provided new document file, a special code as the link information must be re-embedded. When the number of characters from the beginning of a document is used as comment position information, if the number of characters in the provided new document is locally larger/smaller than that in an old document, a position (the number of characters from the beginning) where a comment is to be added changes even if the following contents remain the same. For this reason, a comment cannot be added at a correct position of a new document with the use of position information in a comment file for an unmodified document (old document). Therefore, in this case as well, the position information of a comment must be changed.
In particular, in the case of manuals whose versions are updated by adding some minor revisions or some sentences, the contents of a new document (new version) are not largely different from those of an old document (old version). Therefore, most of comments are still relevant to the new document. However, in the above-mentioned technique, since data of an original document is rewritten, old comments cannot often be utilized. When comments for an old document are to be utilized for a new document, the above-mentioned operation for transferring the comments is required, and such an operation is very troublesome.
It is an object of the present invention to provide a document processing method and apparatus, which can easily re-add additional data added to a certain portion of a first document to an equivalent position in a second document, and can transfer a comment from one document to another efficiently.
It is another object of the present invention to provide a document processing method and apparatus, which, when additional data added to a first document is re-added to an equivalent portion of a second document, can extract a portion having the same character string as that included at the addition position of the additional data in the first document from the second document, and can determine the portion as the equivalent portion.
It is still another object of the present invention to provide a document processing method and apparatus, which, when additional data added to a first document is re-added to an equivalent portion of a second document, can extract a portion having a predetermined similarity or higher to the addition position of the additional data in the first document from the second document as the equivalent portion.
It is still another object of the present invention to provide a document processing method and apparatus, which can extract a portion having a character string, which coincides with a character string of a predetermined number of characters included at the addition position of additional data in a first document, from a second document as an equivalent portion (note that the predetermined number of characters serves as the similarity).
It is still another object of the present invention to provide a document processing method and apparatus, which can extract a portion including a predetermined amount or more of words included at the addition position of additional data in a first document from a second document as an equivalent portion (note that a value for designating the predetermined amount serves as the similarity).
It is still another object of the present invention to provide a document processing method and apparatus, which can desirably set the above-mentioned similarity, and can flexibly extract the equivalent portion.
It is still another object of the present invention to provide a document processing method and apparatus, which can vary the above-mentioned similarity on the basis of a search state of an equivalent portion, and can detect the equivalent portion using an optimal similarity.
It is still another object of the present invention to provide a document processing method and apparatus, which, upon transfer or copy of additional data between first and second documents having a predetermined logical structure, can extract a portion equivalent to the addition position of the additional data in the first document from the second document by utilizing the logical structure.
It is still another object of the present invention to provide a document processing method and apparatus, which, upon efficient transfer of additional data between documents, can store additional data, which could not be transferred, to be distinguished from additional data which could be successfully transferred, and can prevent loss of comments upon transfer of the comments.
It is still another object of the present invention to provide a document processing method and apparatus, which can display additional data which could be successfully transferred to be distinguished from additional data which could not be transferred.
It is still another object of the present invention to provide a document processing method and apparatus, which can identify a correspondence between displayed additional data and a document even when the addition position of the displayed additional data falls outside the current document display range.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.